<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<jsp:include page="/WEB-INF/jsp/common/include_easyui.jsp"></jsp:include>

<script type="text/javascript">

$(function() {

	$('#saveBtn').bind('click', function(){    
		saveData();    
    });  

});

function saveData(){
	
	var isValid = jQuery("#modifyForm").form('validate');
	if(!isValid){
		jQuery("#modifyForm").form('enableValidation');
	}else{
		
		var saveURL = "<%=path%>/userPersonalController/modifyConfigParam?date="+new Date()+"";
		var paramObj = jQuery("#modifyForm").serializeArray();

		jQuery.post(saveURL,paramObj,function(responseData){
			
			var code = responseData.code;
			if (code == "200"){
				$.messager.confirm('操作提示','系统参数修改成功，是否刷新主界面！',function(tag){    
				    if (tag){    
				    	var parentWin = window.parent;
						parentWin.window.location.reload();
						
				    }  
				});

			}else{
				$.messager.alert('我的消息',"系统参数修改出错，原因 ：" + responseData.message,'error');
			}
			
		},"json");
	}
	
}
</script>

<style type="text/css">

.modify-form{
	margin-top:30px;
	position: absolute;
}

.modify-form>div{
	margin-left:12%;
	margin-top:40px;
	width: 88%;
	float: left;
/*	margin-bottom:20px;
 	display: flex;
    justify-content:center; */
}
	
.modify-form>div>label{
	width: 160px;
	text-align: right; 
	height: 40px; 
	line-height: 40px;
	float: left;

}
.modify-form div input{
	max-width: 400px;
	height:26px;
	width:100%;
}
.modify-form .radioSpan{
	width:50%;
	height: 40px; 
	line-height: 40px;
	float: left;
	position: relative;
	border: 1px solid #95B8E7;
	background-color: #fff;
	display: inline-block;
	overflow: hidden;
	white-space: nowrap;
	margin: 0;
	padding: 0;
	-moz-border-radius: 5px 5px 5px 5px;
	-webkit-border-radius: 5px 5px 5px 5px;
	border-radius: 5px 5px 5px 5px;
	display:block;
} 
.modify-form .radioSpan input{
	cursor:pointer;
	max-width: 30px;
	height:20px;
	margin-top: 8px;
	margin-left: 20px;
}
.modify-form .radioSpan span{
	  width:100px; 
	  display: inline-block;
}

</style>
  </head>
  
  <body>
		<form:form modelAttribute="configParam" id="modifyForm" method="post" class="modify-form">
		   	<div>
				<label class="textbox-label textbox-label-before" for="leftMenu" >左边菜单样式：</label>
				<div class="radioSpan">
					<span><form:radiobutton path="leftMenu" value="tree"/>树状菜单</span>
	                <span><form:radiobutton path="leftMenu" value="accordion"/>折叠菜单</span>
	            </div>
	        </div>
	       <div>
				<label class="textbox-label textbox-label-before" for="fontFamily" >字体：</label>
				<div class="radioSpan">
	                <span><form:radiobutton path="fontFamily" value="楷体"></form:radiobutton>楷体</span>
	                <span><form:radiobutton path="fontFamily" value="SimSun"></form:radiobutton>宋体</span>
					<span><form:radiobutton path="fontFamily" value="SimHei"></form:radiobutton>黑体</span>
					<span><form:radiobutton path="fontFamily" value="Microsoft YaHei"></form:radiobutton>微软雅黑</span>
	            </div>
	        </div>	

			<div>
				<label class="textbox-label textbox-label-before" for="fontSize" >字体大小：</label>
				<div class="radioSpan">
					<span><form:radiobutton path="fontSize" value="12"/>12</span>
	                <span><form:radiobutton path="fontSize" value="14"/>14</span>
	                <span><form:radiobutton path="fontSize" value="16"/>16</span>
		   			<span><form:radiobutton path="fontSize" value="18"/>18</span>
	            </div>
	        </div>
		   	<div>
				<div style="padding-left:160px;float: left;">
					<a id="saveBtn" href="javascript:void(0);" class="easyui-linkbutton" 
						data-options="iconCls:'icon-save'" style="height:35px;">确认修改</a>  
				</div>
			</div>
		</form:form> 
			

  </body>
</html>
